home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 26.zip / BS1 part 26 / Aztec C v5.2a disk 4.adf / 204inc_h.lzh / exec / tasks.h < prev    next >
C/C++ Source or Header  |  1991-03-14  |  3KB  |  91 lines

  1. #ifndef    EXEC_TASKS_H
  2. #define    EXEC_TASKS_H
  3. /*
  4. **    $Filename: exec/tasks.h $
  5. **    $Release: 2.04 $
  6. **    $Revision: 36.8 $
  7. **    $Date: 90/05/30 $
  8. **
  9. **    Task Control Block, Singals, and Task flags.
  10. **
  11. **    (C) Copyright 1985,1986,1987,1988,1989 Commodore-Amiga, Inc.
  12. **        All Rights Reserved
  13. */
  14.  
  15. #ifndef EXEC_NODES_H
  16. #include "exec/nodes.h"
  17. #endif /* EXEC_NODES_H */
  18.  
  19. #ifndef EXEC_LISTS_H
  20. #include "exec/lists.h"
  21. #endif /* EXEC_LISTS_H */
  22.  
  23.  
  24. /* Please use Exec functions to modify task structure fields, where available.
  25.  */
  26. struct Task {
  27.     struct  Node tc_Node;
  28.     UBYTE   tc_Flags;
  29.     UBYTE   tc_State;
  30.     BYTE    tc_IDNestCnt;        /* intr disabled nesting*/
  31.     BYTE    tc_TDNestCnt;        /* task disabled nesting*/
  32.     ULONG   tc_SigAlloc;        /* sigs allocated */
  33.     ULONG   tc_SigWait;        /* sigs we are waiting for */
  34.     ULONG   tc_SigRecvd;        /* sigs we have received */
  35.     ULONG   tc_SigExcept;        /* sigs we will take excepts for */
  36.     UWORD   tc_TrapAlloc;        /* traps allocated */
  37.     UWORD   tc_TrapAble;        /* traps enabled */
  38.     APTR    tc_ExceptData;        /* points to except data */
  39.     APTR    tc_ExceptCode;        /* points to except code */
  40.     APTR    tc_TrapData;        /* points to trap code */
  41.     APTR    tc_TrapCode;        /* points to trap data */
  42.     APTR    tc_SPReg;            /* stack pointer        */
  43.     APTR    tc_SPLower;        /* stack lower bound    */
  44.     APTR    tc_SPUpper;        /* stack upper bound + 2*/
  45.     VOID    (*tc_Switch)();        /* task losing CPU      */
  46.     VOID    (*tc_Launch)();        /* task getting CPU  */
  47.     struct  List tc_MemEntry;        /* Allocated memory. Freed by RemTask() */
  48.     APTR    tc_UserData;        /* For use by the task; no restrictions! */
  49. };
  50.  
  51. /*----- Flag Bits ------------------------------------------*/
  52. #define TB_PROCTIME    0
  53. #define TB_ETASK    3
  54. #define TB_STACKCHK    4
  55. #define TB_EXCEPT    5
  56. #define TB_SWITCH    6
  57. #define TB_LAUNCH    7
  58.  
  59. #define TF_PROCTIME    (1<<0)
  60. #define TF_ETASK    (1<<3)
  61. #define TF_STACKCHK    (1<<4)
  62. #define TF_EXCEPT    (1<<5)
  63. #define TF_SWITCH    (1<<6)
  64. #define TF_LAUNCH    (1<<7)
  65.  
  66. /*----- Task States ----------------------------------------*/
  67. #define TS_INVALID    0
  68. #define TS_ADDED    1
  69. #define TS_RUN        2
  70. #define TS_READY    3
  71. #define TS_WAIT    4
  72. #define TS_EXCEPT    5
  73. #define TS_REMOVED    6
  74.  
  75. /*----- Predefined Signals -------------------------------------*/
  76. #define SIGB_ABORT    0
  77. #define SIGB_CHILD    1
  78. #define SIGB_BLIT    4    /* Note: same as SINGLE */
  79. #define SIGB_SINGLE    4    /* Note: same as BLIT */
  80. #define SIGB_INTUITION    5
  81. #define SIGB_DOS    8
  82.  
  83. #define SIGF_ABORT    (1L<<0)
  84. #define SIGF_CHILD    (1L<<1)
  85. #define SIGF_BLIT    (1L<<4)
  86. #define SIGF_SINGLE    (1L<<4)
  87. #define SIGF_INTUITION    (1L<<5)
  88. #define SIGF_DOS    (1L<<8)
  89.  
  90. #endif    /* EXEC_TASKS_H */
  91.